# Maintainer: Levente Polyak <anthraxx[at]archlinux[dot]org>

pkgbase=tftpy
pkgname=('python-tftpy')
pkgver=0.8.2
pkgrel=2
pkgdesc='Pure Python TFTP library'
url='https://github.com/msoulier/tftpy'
arch=('any')
license=('MIT')
makedepends=('python' 'python-setuptools')
source=(${pkgbase}-${pkgver}.tar.gz::https://github.com/msoulier/tftpy/archive/${pkgver}.tar.gz)
sha256sums=('2bfbf6377f6e3b6ba647f0ac614e9cbc225d1cc35b52991860ba6ea1ec58ef9d')
sha512sums=('4e0bf1d2f9daae9509eabd922c2e3d3f6d2d79a24f7fceaf846a822e8024da7f06d9abd92477513f7d538fec39b16030604b7ee2c84278930a4828f6cdec809c')

build() {
  cd ${pkgbase}-${pkgver}
  python setup.py build
}

check() {
  cd ${pkgbase}-${pkgver}
  make test PY=python
}

package_python-tftpy() {
  depends=('python')
  cd ${pkgbase}-${pkgver}
  python setup.py install --root="${pkgdir}" -O1 --skip-build
  install -Dm 644 LICENSE -t "${pkgdir}/usr/share/licenses/${pkgname}"
  install -Dm 644 README ChangeLog -t "${pkgdir}/usr/share/doc/${pkgname}"
  mv "${pkgdir}/usr/bin/tftpy_client"{.py,}
  mv "${pkgdir}/usr/bin/tftpy_server"{.py,}
}

# vim: ts=2 sw=2 et:
